import {componentsFnMap} from '../../config'
const settings = {
    "labelName": `邮储表格`, // 布局管理用来显示
    "componentNameShow": `邮储表格`, // 展示在左侧用来点击添加的
    "componentName": 'yc-web-table', // 
    "children":[], // 容器类租金按
    "tableOptions": {
        'editIndex': 0,
        'btns': [],
        'url': 'dataUrl',
        'method': 'POST',
        'search': false,
        'columns': [{
            'title': '列标题1',
            'field': 'field1',
            'input': '0',
            'isAmount': '0'
        }, {
            'title': '列标题2',
            'field': 'field2'
        }],
        'pagination': true,
        'pageList': [10, 25, 50, 100, 'All'],
        'smartDisplay': false,
        'clickToSelect': true,
        'pageNumber': 1,
        'pageSize': 10,
        'selectRow': '单选'
    }, // 
}
componentsFnMap[settings.componentName] = {
    getHtmlStr(options = {}) {
        let {
            boxId = '', componentName, tableIndex, tableOptions = {}
        } = options
        return `
            <div id="${boxId}"
                class="YCWebTableWidget blockBox formBox fieldBox tabBox ycContainerBox if-component ycWidget YCtable"
                style="height: "
                focusIndex="${tableIndex}">
                <${componentName} 
                    :id="'ycWebTable_${boxId}'" 
                    :options='${JSON.stringify(tableOptions)}'
                >
                </${componentName}>
            </div>  
        `
    },
    getScriptStr (options = {}) {
        let {
            boxId = '', componentName, tableIndex, tableOptions = {}
        } = options
        return `
        /* 
            $.CurrentNavtab['${boxId}'].refreshData([])  
        */
        `
    }
}
export default settings